<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>prencar: D:/Workspace/Arduino/prencar/Move.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="prencar.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">prencar
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_move_8h.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">D:/Workspace/Arduino/prencar/Move.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_move_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef Move_h</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define Move_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;Arduino.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="_communication_8h.html">Communication.h</a>&quot;</span>
<a name="l00006"></a>00006 
<a name="l00010"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">00010</a> <span class="keyword">enum</span> <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a>{ 
<a name="l00011"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02ac692b9392597318793a64449c874c723">00011</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02ac692b9392597318793a64449c874c723" title="Phase out the motor. The power is taken away from the motor but the car can roll a couple of centimer...">phaseOut</a>, 
<a name="l00012"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02a726a0af5164861adac8c015a742dcf21">00012</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02a726a0af5164861adac8c015a742dcf21" title="The motor rotates forward.">forward</a>, 
<a name="l00013"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02ab0b7e8cfed43da5fcfd380964736fadc">00013</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02ab0b7e8cfed43da5fcfd380964736fadc" title="The motor rotates backward.">backwards</a>, 
<a name="l00014"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02a25b14d88f35aee0f0638e63994a6a810">00014</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02a25b14d88f35aee0f0638e63994a6a810" title="The motor is stopped immediately. This is done by shortly giving power in the other direction...">fastStop</a>, 
<a name="l00015"></a><a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02af97e0b201a2ce53937529fe1869f76e1">00015</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02af97e0b201a2ce53937529fe1869f76e1" title="The motor rotates forward or backwards depending on the speed set: positive int value --&gt; forward...">valueDependant</a> 
<a name="l00016"></a>00016 };
<a name="l00017"></a>00017 
<a name="l00018"></a><a class="code" href="class_move.html">00018</a> <span class="keyword">class </span><a class="code" href="class_move.html">Move</a>
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 <span class="keyword">private</span>:
<a name="l00021"></a>00021   <a class="code" href="class_move.html#a4b1acc3a67d30c385ad9a6000526393a">Move</a>();
<a name="l00022"></a><a class="code" href="class_move.html#a1ce3157933da403944e754b380365c93">00022</a>   <span class="keyword">static</span> <a class="code" href="class_move.html">Move</a> <a class="code" href="class_move.html#a1ce3157933da403944e754b380365c93" title="Static reference to the singleton object.">_instance</a>;
<a name="l00023"></a><a class="code" href="class_move.html#ab5a52d3f029707c767ef27a44fa5269a">00023</a>   <span class="keyword">static</span> <span class="keywordtype">boolean</span> <a class="code" href="class_move.html#ab5a52d3f029707c767ef27a44fa5269a">_instanceCreated</a>;
<a name="l00024"></a>00024   <span class="keywordtype">void</span> <a class="code" href="class_move.html#afcff6c5d4fd9e58382ee01d6270f4707">begin</a>();
<a name="l00025"></a><a class="code" href="class_move.html#a280c47406bd7e652c35c7900ca8c745b">00025</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> <a class="code" href="class_move.html#a280c47406bd7e652c35c7900ca8c745b" title="current direction of left motor">_dirLeftMotor</a>; 
<a name="l00026"></a><a class="code" href="class_move.html#ace1041b9df6281fdc960013ccac5c32a">00026</a>   <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> <a class="code" href="class_move.html#ace1041b9df6281fdc960013ccac5c32a" title="current direction of right motor">_dirRightMotor</a>; 
<a name="l00027"></a><a class="code" href="class_move.html#ada9423f195c9ee65b5448fcaabb96877">00027</a>   byte <a class="code" href="class_move.html#ada9423f195c9ee65b5448fcaabb96877" title="current speed of left motor (pwm value 0-255)">_speedLeft</a>; 
<a name="l00028"></a><a class="code" href="class_move.html#a13362460beddf2de2415d51f3ed70841">00028</a>   byte <a class="code" href="class_move.html#a13362460beddf2de2415d51f3ed70841" title="current speed of right motor (pwm value 0-255)">_speedRight</a>; 
<a name="l00029"></a>00029 
<a name="l00030"></a><a class="code" href="class_move.html#ae9e6d0860fc8dcf67798b19b961044cc">00030</a>   <a class="code" href="class_communication.html">Communication</a>* <a class="code" href="class_move.html#ae9e6d0860fc8dcf67798b19b961044cc" title="The reference to the serial communication class.">_com</a>; 
<a name="l00031"></a><a class="code" href="class_move.html#ad5c8392b7540a9b46adf66918ef83fdb">00031</a>   <a class="code" href="class_configuration.html">Configuration</a>* <a class="code" href="class_move.html#ad5c8392b7540a9b46adf66918ef83fdb" title="The reference to the configuration class.">_conf</a>; 
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00033"></a>00033   <span class="keyword">static</span> <a class="code" href="class_move.html">Move</a>* <a class="code" href="class_move.html#a5b53cfa443fe4fe0f1b96f9b3afc4850">getInstance</a>();
<a name="l00034"></a>00034 
<a name="l00035"></a>00035   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a237261f2dd8fc115129f0ba998f13183">performFastStop</a>();
<a name="l00036"></a>00036   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a9c5dc5c3a98abece0c2f40085c3601be">controlMotors</a>(<a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> dirLeftMotor, <span class="keywordtype">int</span> speedLeftMotor, <a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> dirRightMotor, <span class="keywordtype">int</span> speedRightMotor);
<a name="l00037"></a>00037   <span class="keywordtype">void</span> <a class="code" href="class_move.html#af6b1197771f0540b0becc4117d8d272f">setLeftMotorDirection</a>(<a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> dir);
<a name="l00038"></a>00038   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a06e67dafd581bbd086da404a90c4eeec">setRightMotorDirection</a>(<a class="code" href="_move_8h.html#a4d576498f070661245f38f5f34d34f02">TMotorDirection</a> dir);
<a name="l00039"></a>00039   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a0d9285d4088aa0c6fdab04f0a0e5df2c">changeMotorSpeed</a>(<span class="keywordtype">int</span> changeLeftMotor, <span class="keywordtype">int</span> changeRightMotor);
<a name="l00040"></a>00040   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a9d25d16f505526378fb4e43ee9e3b8c5">setMotorSpeed</a>(<span class="keywordtype">int</span> speedLeftMotor, <span class="keywordtype">int</span> speedRightMotor);
<a name="l00041"></a>00041   <span class="keywordtype">void</span> <a class="code" href="class_move.html#a8dfdbb462ec42c3a2b4682db5cd5c692">equalizeMotorsSpeed</a>();
<a name="l00042"></a>00042 };
<a name="l00043"></a>00043 <span class="preprocessor">#endif</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_move_8h.html">Move.h</a>      </li>

    <li class="footer">Generated on Thu Jun 7 2012 20:47:43 for prencar by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
